<?php
$img_file = $_GET['img_file'];

echo "Hi...<br />";

if($img_file!=''){
	define('ROOT_PATH', strtr(dirname( __FILE__ ) ."/",array('\\'=>'/')));
	require_once ROOT_PATH."core/Init.php";

	if(file_exists(ROOT_PATH."thumb_max/$img_file"))
	{
		/*if(dirname($img_file)!=''){
			$deldir = "./thumb_max/".dirname($img_file)."/*";
			system("rm -fr $deldir");
			
			echo ROOT_PATH."unlink $deldir<br />";
		}
		else*/
		{
			unlink(ROOT_PATH."thumb_max/$img_file");
			echo ROOT_PATH."unlink thumb_max/$img_file<br />";
		}
	}
	
	foreach (IMGlobal::$thumb_in_size as $thumb_in)
	{
		if(file_exists(ROOT_PATH."thumb_in/$thumb_in/$img_file"))
		{
			unlink(ROOT_PATH."thumb_in/$thumb_in/$img_file");
			echo ROOT_PATH."unlink thumb_in/$thumb_in/$img_file<br />";
		}
	}
	
	foreach (IMGlobal::$thumb_w_size as $thumb_w)
	{
		if(file_exists(ROOT_PATH."thumb_w/$thumb_w/$img_file"))
		{
			unlink(ROOT_PATH."thumb_w/$thumb_w/$img_file");
			echo ROOT_PATH."unlink thumb_w/$thumb_w/$img_file<br />";
		}
	}
	
	foreach (IMGlobal::$thumb_wl_size as $thumb_wl)
	{
		if(file_exists(ROOT_PATH."thumb_wl/$thumb_wl/$img_file"))
		{
			unlink(ROOT_PATH."thumb_wl/$thumb_wl/$img_file");
			echo ROOT_PATH."unlink thumb_wl/$thumb_wl/$img_file<br />";
		}
	}
	
	foreach (IMGlobal::$thumb_size as $thumb)
	{
		if(file_exists("thumb/$thumb/$img_file"))
		{
			unlink("thumb/$thumb/$img_file");
			echo "unlink thumb/$thumb/$img_file<br />";
		}
	}
}
?>